package com.javajun.endofterm.common;

import org.springframework.data.domain.Page;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author: Xiong Limin
 * Date: 2020-12-01-10:55 下午
 */
public class DataGridUtils {
    public static HashMap<String, Object> buildResult(Page page) {
        HashMap<String, Object> result=new HashMap<>();
        result.put("code", 0);
        result.put("msg","");
        result.put("number", page.getNumberOfElements());
        result.put("count", page.getTotalElements());
        result.put("data", page.getContent());
        return result;
    }
}
